UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xWkt026B9DcJoWdJoHtoNFc6kG1f6FxM3xkamSPpwbc='
WHERE
key_id = 'f71b2a7c9a0db6505323d126fba6ec98164d1c22e7e2eab94cb947db67eef47c'
AND (
token = 'xWkt026B9DcJoWdJoHtoNFc6kG1f6FxM3xkamSPpwbc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)