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