UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'R/fggdA4eCElwGnmFsVpW2bjN1AgEq64KZkraMyAw9M='
WHERE
key_id = 'f8c7f4112d7ad4ca4418a055466deefdfdeca5f0dc92aa49714498eeced78b8e'
AND (
token = 'R/fggdA4eCElwGnmFsVpW2bjN1AgEq64KZkraMyAw9M='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)