UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'cL5vjklOHzMf9MUFZhRGHeoix5is6GiOQBdV6DspGE8='
WHERE
key_id = '0a27b85c4ebb71bb9e40c447fafb8a6dd04d7ac8f52f301dc7a36e6d7dc81821'
AND (
token = 'cL5vjklOHzMf9MUFZhRGHeoix5is6GiOQBdV6DspGE8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)