UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'vimNF7fZWiMHJcAAIDLizttrCu6naj91qhaLJr07Ssw='
WHERE
key_id = '0b0d5ad95bcbe74792a41569ed2267fbbb88c2d8b7db9a5ff63dcef73a68bb78'
AND (
token = 'vimNF7fZWiMHJcAAIDLizttrCu6naj91qhaLJr07Ssw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)