UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'AwylQ00IW0a9RzzY5CeA0cnBlIxqz9pyVn6CKJHpVPk='
WHERE
key_id = '3b220a1f020947ad6bd2be2254a1c7dd2cecc8b6a99f40895b1803ce67db518f'
AND (
token = 'AwylQ00IW0a9RzzY5CeA0cnBlIxqz9pyVn6CKJHpVPk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)