UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'nFglhiCXJCb6y3/0dhYNjCM4NdzSCh2wzXLC2R0UCzE='
WHERE
key_id = 'a29e7af0ce7725638e5e0c8add81fde1de08ef4c557be3203b3976e80844153b'
AND (
token = 'nFglhiCXJCb6y3/0dhYNjCM4NdzSCh2wzXLC2R0UCzE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)