UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'S+X/9gGaPqcdphPgmsxHp1eLoNKDigvIF8vWYI/IFYQ=' 
WHERE 
  key_id = 'fc8968afd5a0728221e510a409487b94d65fd190e4e7e4ffb4ff599d493376d4' 
  AND (
    token = 'S+X/9gGaPqcdphPgmsxHp1eLoNKDigvIF8vWYI/IFYQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00048