UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'GeKTHLhLLK43f9szgmOsJJufH7/D/El8DPqVErlug5k='
WHERE
key_id = '59134134a71b3497bfd9ef387fc7b6c80c2430b3220007f15a7a8b0fb1c16c08'
AND (
token = 'GeKTHLhLLK43f9szgmOsJJufH7/D/El8DPqVErlug5k='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)