UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'JQe2YzFeogNrmM889voWPsr0OFId0g+CAu2FODxKVAE='
WHERE
key_id = '5a48dd1de689bb87bef32c450edeeda6b84041c507fb9d72d75846999ad7b87a'
AND (
token = 'JQe2YzFeogNrmM889voWPsr0OFId0g+CAu2FODxKVAE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)