UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/Z1fFmH1vKEod61NdIrO7829blrm1NSmCtLGd+XK+pE='
WHERE
key_id = '45393e72526fc633e2baa9d1adc43ea6472cfbaf4379da66ca69bcfe98f3aed5'
AND (
token = '/Z1fFmH1vKEod61NdIrO7829blrm1NSmCtLGd+XK+pE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)