UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'czzeOS0GkWv4fOBaqAxRpMl66zFoUDD5r8BPB+5KNOY='
WHERE
key_id = '5c13f1c3f9b8d337763eb2a1857ee2e6cd4b032a156240225cf15dba96905ec6'
AND (
token = 'czzeOS0GkWv4fOBaqAxRpMl66zFoUDD5r8BPB+5KNOY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)