UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1/ZaPCOq9hz4OdZ9v4k460poYX0VmY0m0H6pZpOW8Kg='
WHERE
key_id = 'd813090c46ee77b6450774b6156997966553ce35f0cd540f2ff0a7514b562c13'
AND (
token = '1/ZaPCOq9hz4OdZ9v4k460poYX0VmY0m0H6pZpOW8Kg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)