UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '5EYZIehskRtm6+vZwUEghN64wgHsNhvTkHNiDKoJmiQ=' 
WHERE 
  key_id = '9736c55aedf2775bec73a3b1996cfe427708ef7239350474cb3f426fa20b8c14' 
  AND (
    token = '5EYZIehskRtm6+vZwUEghN64wgHsNhvTkHNiDKoJmiQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035