UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xBQ33wIpp7CemHE1rghvNzKnif9mzDtNV5esKPxUDG4='
WHERE
key_id = '4e70571e0e6a907660478bb2418b105fada3893fd4348db87c2fb0f65dc284ad'
AND (
token = 'xBQ33wIpp7CemHE1rghvNzKnif9mzDtNV5esKPxUDG4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)