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