UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1ZJyclsk3o3TTjhMStM0pl4ZuU4aKCx0zEHW9O+IXyU=' 
WHERE 
  key_id = '7d8c121dd06ba3752a2d765e1fa2822d78cfc519efe1bfd687cd5f86359e871d' 
  AND (
    token = '1ZJyclsk3o3TTjhMStM0pl4ZuU4aKCx0zEHW9O+IXyU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021