UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '94fuHWdbwzPdjAct5em0c9NY+pcJf5G4Gq45GbeBZM4='
WHERE
key_id = '0c7cbe8a58196fbb6be911fc715286d01b4cdcd27dcdfc5c11b810f0ca3aaa95'
AND (
token = '94fuHWdbwzPdjAct5em0c9NY+pcJf5G4Gq45GbeBZM4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)