UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'QyFiKEr66zIJvH1ONp/U6riKNw3FWCR9233njwTdGYI=' 
WHERE 
  key_id = 'e1815bc93d45b75177e23cd59fe94df97672815d079ea8a6a2de6dbc5582fd53' 
  AND (
    token = 'QyFiKEr66zIJvH1ONp/U6riKNw3FWCR9233njwTdGYI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027