UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'dOd/yn/0vjvStLmCTOe7LNMaGr4qyTeuDCgwMr4FywU='
WHERE
key_id = '2be082ebcd51e076be267a28718f330e9c2a4d4f02030c3609c7f0eb4b28e36f'
AND (
token = 'dOd/yn/0vjvStLmCTOe7LNMaGr4qyTeuDCgwMr4FywU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)