UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4SJ9zSreRA9BHQWvwgk/nLNAbkryjyMF5R2Bp3FseI4='
WHERE
key_id = '1ffeb19be78349e82437aabcc6baf7b71b2a66be3c1b026d1971dad96629767d'
AND (
token = '4SJ9zSreRA9BHQWvwgk/nLNAbkryjyMF5R2Bp3FseI4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)