UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'z9D3/PwnYTYIt1IWm4TG807aehSYiTI042veA3fpD/s=' 
WHERE 
  key_id = '183c353c70e2e8c6c8bd2424f0d313b36e43c4e571e3659d4974330a58ba0d4c' 
  AND (
    token = 'z9D3/PwnYTYIt1IWm4TG807aehSYiTI042veA3fpD/s=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021