UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'R0aimQBELaqVR6HCzjlZY+fhA8uoTHqivbxQ/aG0ZYk=' 
WHERE 
  key_id = '73b504ae302af60993d4d7bb4a9551c86e3c57ba10caea9d2ca2b12bd1030960' 
  AND (
    token = 'R0aimQBELaqVR6HCzjlZY+fhA8uoTHqivbxQ/aG0ZYk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030