UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 's/sKGFIXuxv7JEJTKxf7GrQbDRfrfBPKewynIUTKJdo='
WHERE
key_id = '4c74be56218d0450cb9db72c868375d10ab2298daff242b9814e8f8c3c00b35c'
AND (
token = 's/sKGFIXuxv7JEJTKxf7GrQbDRfrfBPKewynIUTKJdo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)