UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'IQ2lumr7rvLlyLZW/j4ki/oBxtp2KBMMlomQc0aihnA='
WHERE
key_id = '3a98f9d54c186b372c066b819cd8fb8e07fe8a9ee7e8cfd6c94752d3a2ba345a'
AND (
token = 'IQ2lumr7rvLlyLZW/j4ki/oBxtp2KBMMlomQc0aihnA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)