UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'RCaHhTjnNo2gY18xiHVYR3dpo89Y1HduliOurMtJmNA='
WHERE
key_id = '3e93dcdc42cffd5646966ae403c4c194b371443cf3820467623d5b86ed98a4c9'
AND (
token = 'RCaHhTjnNo2gY18xiHVYR3dpo89Y1HduliOurMtJmNA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)