UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'VW3ViuuEvFauN44X1DZV8EQUEAA/RYtgjx+bpXyvJFg='
WHERE
key_id = 'ecf726575cd56f92c92f28d3fe526fe9cde52dbf906a5da8ce578fe30fd5b0c3'
AND (
token = 'VW3ViuuEvFauN44X1DZV8EQUEAA/RYtgjx+bpXyvJFg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)