UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '445ddutZqo91HGH7Ju5giSmXeoTIqv3QyIqJsYE4EvM='
WHERE
key_id = '51c4836b948035a9a6ab6d5e75354eb0ef2075e097b7e1dd4c0a43fa11b42b3e'
AND (
token = '445ddutZqo91HGH7Ju5giSmXeoTIqv3QyIqJsYE4EvM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)