UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'H+drigvnD/GpXB5jqzwiLpkZ87h/EjV3uczk/W4L/Qo='
WHERE
key_id = 'dc2ca271eb5e20f4f0f3f66db88971a2bdc89570e48d092422776917dbd76c69'
AND (
token = 'H+drigvnD/GpXB5jqzwiLpkZ87h/EjV3uczk/W4L/Qo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)