UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'N8XIO8EWwKLNbyv/nJj5O/LQ5DOucHbEsFBpK3OoH8s='
WHERE
key_id = '115ae24e745388136695fcacc794d0f931bc37f96387984014ced5d51f13545e'
AND (
token = 'N8XIO8EWwKLNbyv/nJj5O/LQ5DOucHbEsFBpK3OoH8s='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)