UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'KOgiFFiY6RZtvBvOlnQiBp/zJ4serEbS0O7FlkqyLTU='
WHERE
key_id = 'a95d8f9ab30344c0d97bbcb6980256dc40a8eeca8e25f8533283024db91ce9a7'
AND (
token = 'KOgiFFiY6RZtvBvOlnQiBp/zJ4serEbS0O7FlkqyLTU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)