UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'cs0YuWFLJJk8YNT+qoSURzk7vDdCOMn0CVeAn3AoVmI=' 
WHERE 
  key_id = '4daac9d8e885f69a8e6ffaa7ac526bb5292b24f4be4ec525030c91e4215a87fa' 
  AND (
    token = 'cs0YuWFLJJk8YNT+qoSURzk7vDdCOMn0CVeAn3AoVmI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00049