UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'tkO+3BulzCMDWwZT057ES4gt2HOu+/5B7J6ZR2z82Qs='
WHERE
key_id = '093c6967406604d2c7b8405de7728e6e22e40e01cfca0663cbfa63981761721f'
AND (
token = 'tkO+3BulzCMDWwZT057ES4gt2HOu+/5B7J6ZR2z82Qs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)