UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'e16q1Hg9QTYSiJt/USN07W+fdOIn/ji1R9bdG35oRVg=' 
WHERE 
  key_id = 'a2d5a847e785d6f70b57a5fea61a9ab53297a4b792e631fc923b6ff66a1d19f4' 
  AND (
    token = 'e16q1Hg9QTYSiJt/USN07W+fdOIn/ji1R9bdG35oRVg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032